package se.sics.tac.aw;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import java.util.Vector;

public class HotelBiddingTest {
	HotelBidding hb;

	@Before
	public void setUp() throws Exception {
		hb = new HotelBidding();
	}

	@Test
	public void testGetAvgValueOfHotel() {
		for (int i=0; i<8; i++) {
			System.out.println("Average value of hotel " + i + ": " + hb.getAvgValueOfHotel(i));
			assertTrue(hb.getAvgValueOfHotel(i) > 0f);
		}
	}

	@Test
	public void testGetHotelPriceDiff() {
		System.out.println("Average value price difference between hotel types: " + hb.getHotelPriceDiff(1,4));
		assertTrue(hb.getHotelPriceDiff(1,4) > 0f);
	}

	@Test
	public void testGetBidPrices() {
		Vector<Float> marginalValues = new Vector<Float>();
		marginalValues.add(60f);
		marginalValues.add(50f);
		
		float askPrice = 0f;
		int minute = 1;
		
		float[] bidPrices = hb.getBidPrices(16, marginalValues, askPrice, minute, 3, false);
		System.out.println("bid prices for minute 1");
		for (int i=0; i<bidPrices.length; i++)
			System.out.println("Price " + i + ": " + bidPrices[i]);
	}
	
	@Test
	public void testPrepareBasicBids() {
		System.out.println("testPrepareBasicBids()");
		float[] v = new float[] {400f, 200f, 10f};
		float[] bidPrices = hb.prepareBasicBids(10, v, 0f);
	
		for (int i=0; i<bidPrices.length; i++)
			System.out.println("Price " + i + ": " + bidPrices[i]);
	
	}

}
